<script setup>
import { computed, ref } from 'vue';

// 1. 成绩数组
const scoreList = ref([80, 85, 90, 95, 100, 70])
// 2. 计算属性(优秀的成绩)
const betterList = computed(() => scoreList.value.filter(item => item >= 90))

</script>

<template>
  <div>
    <div>成绩: {{ scoreList }}</div>
    <div>优秀的成绩: {{ betterList }}</div>
    <button @click="scoreList.push(99, 98, 70)">添加成绩</button>
  </div>
</template>

<style scoped></style>
